import { h, render } from 'vue'

/**
 *  挂载组件到body中
 * @param Component 组件实例的选项对象
 * @param props 组件实例中的prop
 */
export function createGlobalComponent(Component, props) {
  const vnode = h(Component, props)
  render(vnode, document.body)
  vnode.remove = () => {
    render(null, document.body)
  }
  return vnode
}
